import type { Metadata } from 'next'; import Link from 'next/link'; import { notFound } from 'next/navigation'; import { publicProfile } from '@/lib/account/queries'; import { Card, CardHeader, Delta, Table, th, td, tdNum } from '@/components/ui/primitives'; import { Donut } from '@/components/account/charts'; import { ValueSourceBadge } from '@/components/account/portfolio-widgets'; import { fmtMoney, confidenceLabel } from '@/lib/format'; export async function generateMetadata({ params }: { params: Promise<{ handle: string; slug: string }> }): Promise { const { handle, slug } = await params; const p = await publicProfile(handle); const c = p?.collections.find((x) => x.collection.publicSlug === slug); if (!p || !c) return { title: 'Collection not found' }; return { title: `${c.collection.name} · ${p.user.name ?? `@${handle}`}`, description: c.collection.description ?? `${c.summary.itemCount} items on RareIndex` }; } export default async function PublicCollectionPage({ params }: { params: Promise<{ handle: string; slug: string }> }) { const { handle, slug } = await params; const p = await publicProfile(handle); const c = p?.collections.find((x) => x.collection.publicSlug === slug); if (!p || !c) notFound(); const items = p.items.filter((i) => i.collectionId === c.collection.id); const rows = [...c.summary.items].sort((a, b) => (b.valueUsd ?? 0) - (a.valueUsd ?? 0)); return (

{c.collection.name}

{c.collection.description ?

{c.collection.description}

: null}

{c.summary.valuedCount ? fmtMoney(c.summary.valueUsd) : '—'}

{c.summary.itemCount} items · confidence {confidenceLabel(c.summary.confidence)}

({ label: b.label, value: b.valueUsd }))} size={100} />
{rows.map((i) => { const src = items.find((x) => x.id === i.id)!; return ( ); })}
Item Variant Qty Value Basis
{src.photos[0] || src.heroImageUrl ? ( // eslint-disable-next-line @next/next/no-img-element ) : ( )} {i.title}
{src.variantLabel ?? (i.grader ? `${i.grader.toUpperCase()} ${i.grade ?? ''}` : src.condition ?? '—')} {i.quantity} {i.valueUsd === null ? — : fmtMoney(i.valueUsd)}

Shared by @{handle}. Values are RareIndex Valuation estimates; return is shown without purchase details. RareIndex does not authenticate items.

); }